﻿
Public Class Producto : Implements IEquatable(Of Producto)

    Public Property Nombre As String
    Public Property Precio As Decimal
    Public Property Descripcion As String

    Public ReadOnly Property nomFoto As String

        Get
            Return My.Application.Info.DirectoryPath & "\Fotos\" & Nombre & ".jpg"
        End Get
    End Property

    Public Sub New()
    End Sub

    Public Sub New(ByVal nombre As String, ByVal precio As Decimal, ByVal descripcion As String)
        Me.Nombre = nombre
        Me.Precio = precio
        Me.Descripcion = descripcion
    End Sub

    Public Overloads Function Equals(other As Producto) As Boolean Implements System.IEquatable(Of Producto).Equals
        Return Me.Nombre = other.Nombre
    End Function
End Class
